package demo2;

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintWriter;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 石方旭
 * Date: 2022-08-09
 * Time: 10:06
 */
public class TestDemo2 {

    public static void main(String[] args) {
        try(OutputStream outPutStream = new FileOutputStream("text.txt")){
           try( PrintWriter writer = new PrintWriter(outPutStream)) {
               writer.println("hello,java");
           }
        }catch(IOException e){
            e.printStackTrace();
        }
    }


}
